function addVender() {
    Ajax.getHtml('po/venderAdd.html', function (html) {
        layer.open({
            type: 1,
            title: '新增供应商',
            area: ['600px'],
            content: html,
            btn: ['确认', '取消'],
            yes: function () {
                saveVender()
            },
            btn2: function () {
                console.log('取消新增供应商')
            }
        })
    })
}

function saveVender() {
    Ajax.post(
        '/addVender',
        {
            venderCode:$("#venderCode").val(),
            name:$("#vendername").val(),
            password:$("#password").val(),
            contactor:$("#contactor").val(),
            address:$("#address").val(),
            postCode:$("#postcode").val(),
            tel:$("#tel").val(),
            fax:$("#fax").val()
        },
        function (result) {
            doResult(result, function () {
                layer.closeAll()
                show('po/vender.html')
                layer.alert(result.msg)
            })
        }
    )
}
function updatevender() {
    Ajax.post(
        '/updateVender',
        {
            venderCode:$("#venderCode").val(),
            name:$("#vendername").val(),
            password:$("#password").val(),
            contactor:$("#contactor").val(),
            address:$("#address").val(),
            postCode:$("#postcode").val(),
            tel:$("#tel").val(),
            fax:$("#fax").val()
        },
        function (result) {
            doResult(result, function () {
                layer.closeAll()
                show('po/vender.html')
                layer.alert(result.msg)
            })
        }
    )
}
